/* 
 * 练习9：内容如下面英文所述。 
* Create a class called Root that contains an instance of each of the classes
* (that you also create) named Component1, Component2 and Component3. Derive a 
* class Stem from Root that also contains an instance of each "component." All 
* classes should have default constructors that print a message about that class.
*/
 
package chapter7_Reusing;
import publicLibs.p;

class Component1 {
	Component1() { p.p("Component1()"); }
}

class Component2 {
	Component2() { p.p("Component2()"); }
}

class Component3 {
	Component3() { p.p("Component3()"); }
}

class Root { 
	Component1 c1root = new Component1();
	Component2 c2root = new Component2();
	Component3 c3root = new Component3();
	Root() { p.p("Root()"); }
}

public class E9_Stem extends Root {
	
	Component1 c1stem = new Component1();
	Component2 c2stem = new Component2();
	Component3 c3stem = new Component3();
	E9_Stem() { p.p("Stem()"); } 
	
	public static void main(String[] args) {
		E9_Stem e = new E9_Stem();
	}

}
